<%@ page contentType="text/html; charset=utf-8" language="java"
	errorPage=""%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<html>
	<head>
		<TITLE>权限管理--用户组列表</TITLE>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<LINK href="./jsp/manage/css/style.css" type=text/css rel=stylesheet>
		<style type="text/css" media="all">
@import "./jsp/manage/css/global.css";

@import "./jsp/manage/thickbox-code/thickbox.css";
        </style>
		<link rel="stylesheet" id='skin' type="text/css"
			href="./jsp/manage/css/ymPrompt.css" />
		<script src="./jsp/manage/js/jquery-compressed.js"
			type="text/javascript"></script>
		<script src="./jsp/manage/js/thickbox.js" type="text/javascript"></script>
		<script src="./jsp/manage/js/global.js" type="text/javascript"></script>
		<script src="./jsp/manage/js/mon.js" type="text/javascript"></script>
		<script type="text/javascript" src="./jsp/manage/js/ymPrompt.js"></script>
		<script language="javascript" type="text/javascript">
		function fnOnPageChanged(page) {
			var url = '<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&pageNow='+page;
			document.location.href = url;
		}
		</script>
		<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 5px;
}
.STYLE1 {
	color: #003399;
	font-weight: bold;
}
-->
        </style>
	</head>
	<body>
		<div id="content">
			<TABLE class=border cellSpacing=1 cellPadding=2 width="100%"
				align=center border=0>
				<TBODY>
					<TR class=topbg>
						<TD align=middle colSpan=2 height=22>
							<STRONG>权限管理</STRONG>
						</TD>
					</TR>
					<TR class=topbg>
						<TD align=left colSpan=2 height=22>
							<STRONG>权限管理 [</STRONG>
							<span class="STYLE1"><a href="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist">用户组列表</a>]</span>
							<span class="STYLE1">[<a href="<%=request.getContextPath()%>/quanxianManage.do?method=groupadd">添加新用户组</a>]</span></TD>
					</TR>
				</TBODY>
			</TABLE>
			<table border="0" width="100%" align="center">
					<tr>
						<td align="center">
							<form
								action="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&Action=Manage"
								method="post">
								<SELECT size=1 name=keywordType>
									<OPTION value="groupName" selected>
										用户组名
									</OPTION>
								</SELECT>
								<input name="keyword" type="text" size="40" maxlength="40" />
								<input name="button" type="submit" value="查找" />
							</form>
						</td>
					</tr>
				</table>
				<form name="form_1" method="post">
					<table width="100%" border="0" cellspacing="0" cellpadding="0"
						class="data">
						<tr>
							<th  align="center" nowrap="nowrap">
								<div align="center">编号</div>
							</th>
							<th width="15%" align="center" nowrap="nowrap">用户组</th>
							<th  width="20%"  align="center" nowrap="nowrap">描述</th>
							<th width="10%" align="center" nowrap="nowrap">操作</th>
						</tr>
						<c:forEach items="${grouplist}" var="group">
							<c:if test="${group.id%2==1}">
								<c:set var="rowtype" value="odd" />
							</c:if>
							<c:if test="${group.id%2==0}">
								<c:set var="rowtype" value="even" />
							</c:if>
							<tr class="${rowtype}" onMouseOver="this.className = 'row_over';"
								onMouseOut="this.className = '${rowtype}';" >
								<td width="7%" align="center" nowrap="nowrap">${group.id}</td>
								<td align="center" nowrap="nowrap">
								<a href="<%=request.getContextPath()%>/quanxianManage.do?method=groupview&id=${group.id}">
									${group.groupName}
								</a>
								</td>

								<td align="center" nowrap="nowrap">${group.descn}</td>
								<td align="center" nowrap="nowrap">
									 <a href="<%=request.getContextPath()%>/quanxianManage.do?method=groupedit&id=${group.id}">编辑</a> 
									|
									<a href="<%=request.getContextPath()%>/quanxianManage.do?method=groupdel&id=${group.id}"
										onClick="return confirm('您确定要删除 ${group.groupName}用户组吗？');">删除</a>	
								</td>
                          </tr>
						</c:forEach>
						<tr>
							<td colspan="17" align="center" bgcolor="#FCFCFC">
								<div align="left">
									<span style="font-size: 13px">共<b>${entryTatal}</b>
										条记录&nbsp;&nbsp; <a
										href="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&pageNow=1">首页
									</a> <c:choose>
											<c:when test="${pageNow>1}">
												<a
													href="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&pageNow=${pageNow-1}">上一页</a>											</c:when>
											<c:otherwise> 上一页 </c:otherwise>
										</c:choose> <c:choose>
											<c:when test="${pageNow<pageTatal}">
												<a
													href="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&pageNow=${pageNow+1}">下一页</a>											</c:when>
											<c:otherwise> 下一页 </c:otherwise>
										</c:choose> <a
										href="<%=request.getContextPath()%>/quanxianManage.do?method=grouplist&pageNow=${pageTatal}">尾页</a>
										页次：<strong><font color="red">${pageNow}</font>/${pageTatal}</strong>页
										&nbsp;共<b>${entryTatal}</b>条记录 共 <b>${pageTatal}</b>
										页&nbsp;&nbsp;转到第 <select name="pagejump"
											onChange="fnOnPageChanged(this.value);">

											<c:forEach begin="1" end="${pageTatal}" var="i" step="1">
												<c:if test="${pageNow==i}">
													<option value="${i}" selected>
														&nbsp;&nbsp;${pageNow}&nbsp;&nbsp;													</option>
												</c:if>
												<c:if test="${pageNow!=i}">
													<option value="<c:out value="${i}"/>">
														&nbsp;&nbsp;
														<c:out value="${i}" />
														&nbsp;&nbsp;
													</option>
												</c:if>
											</c:forEach>
										</select> 页</span>								
								</div>
							</td>
						</tr>
					</table>
					<table width="100%" border="0" cellpadding="2" cellspacing="0">
						<tr>
							<td>&nbsp;
							</td>
						</tr>
					</table>
				</form>
			</div>
	</body>
</html>
<script type="text/javascript">
function handler(tp){
if(tp=='ok'){
   document.form_1.action="<%=request.getContextPath()%>user.do?method=userApprove&approveState=1"
   document.form_1.submit(); 
}
if(tp=='cancel'){}
if(tp=='close'){}
}

function handler2(tp){
if(tp=='ok'){
   document.form_1.action="<%=request.getContextPath()%>user.do?method=userApprove&approveState=2";
   document.form_1.submit(); 
}
if(tp=='cancel'){}
if(tp=='close'){}
}
</script>